package com.jike.jkgame.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class ResourceSQLiteHelper extends SQLiteOpenHelper{

	private static final String DATABASE_NAME = "gameresource.db";
	private static final int DATABASE_VERSION = 1;
	
	public ResourceSQLiteHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		DataFilesTable.onCreate(db);
		MissionTable.onCreate(db);
		CitiesTable.onCreate(db);
		EventsTable.onCreate(db);
		EquipmentsTable.onCreate(db);
		GeneralsTable.onCreate(db);
		SkillsTable.onCreate(db);
		FragmentsTable.onCreate(db);
		TreasuresTable.onCreate(db);
		MiscUpperTable.onCreate(db);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		DataFilesTable.onUpgrade(db, oldVersion, newVersion);
		MissionTable.onUpgrade(db, oldVersion, newVersion);
		CitiesTable.onUpgrade(db, oldVersion, newVersion);
		EventsTable.onUpgrade(db, oldVersion, newVersion);
		EquipmentsTable.onUpgrade(db, oldVersion, newVersion);
		GeneralsTable.onUpgrade(db, oldVersion, newVersion);
		SkillsTable.onUpgrade(db, oldVersion, newVersion);
		FragmentsTable.onUpgrade(db, oldVersion, newVersion);
		TreasuresTable.onUpgrade(db, oldVersion, newVersion);
		MiscUpperTable.onUpgrade(db, oldVersion, newVersion);
	}

}
